package kr.hkit.androidcomplete01.ch13;

import kr.hkit.androidcomplete01.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.RatingBar;
import android.widget.TextView;

public class RatingBarTest extends Activity {
	
	RatingBar mRating;
	TextView mRateText;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.ch13_ratingbartest);
		
		mRating = (RatingBar) findViewById(R.id.ratingbar);
		mRateText = (TextView) findViewById(R.id.ratetext);
		
		mRating.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() {
			
			@Override
			public void onRatingChanged(RatingBar ratingBar, float rating,
					boolean fromUser) {
				mRateText.setText("Now Rate : " + rating);
				
			}
		});
	}

}
